<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="resource/jquery-3.4.1.min.js"></script>
</head>
<body>
    <div id="box">
        <p>奥术大师</p>
    </div>
    <script>
        //根据id匹配一个元素,id是唯一的
        console.log($("#box"));
        console.log($("#box").css('color','pink'));
    </script>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
    <script>
        //根据标签名匹配所有元素
        console.log($("ul"));
        console.log($("li"));
        console.log($("div"));
    </script>
    <div class="box1"></div>
    <div class="box1"></div>
    <div class="box1"></div>
    <span class="box1"></span>
    <span>
        231654
    </span>
    <script>
        //根据class名匹配元素,同class名的元素都可以匹配到
        console.log($(".box1"));
        //同时匹配多个选择器的元素,中间用,隔开
        console.log($("span,li,div.box1"));
    </script>
</body>
</html>